#include "curl_setup.h"
#include "vzenith_sha1.h"

#if defined(USE_OPENSSL)

#include <openssl/opensslv.h>
#include <openssl/hmac.h>

void hmac_sha1(
  unsigned char *output,
  size_t *outsize,
  const char *key,
  int keylen,
  const unsigned char *input,
  size_t insize) {
  HMAC_CTX ctx;
  HMAC_CTX_init(&ctx);
  HMAC_Init_ex(&ctx, key, keylen, EVP_sha1(), NULL);
  HMAC_Update(&ctx, input, insize);
  HMAC_Final(&ctx, output, outsize);
  HMAC_CTX_cleanup(&ctx);
}

#endif
